export class AssetLoader {
  constructor() { this.cache = new Map(); }
  async loadImage(url) {
    if (this.cache.has(url)) return this.cache.get(url);
    const img = new Image(); img.src = url;
    await img.decode(); this.cache.set(url, img); return img;
  }
}